package com.itheima.mybatis02.bean;

import java.util.Objects;

public class Card {
    private Integer id;
    private Integer number;

    private Person person;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Card card = (Card) o;
        return Objects.equals(id, card.id) &&
                Objects.equals(number, card.number) &&
                Objects.equals(person, card.person);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, number, person);
    }

    @Override
    public String toString() {
        return "Card{" +
                "id=" + id +
                ", number=" + number +
                ", person=" + person +
                '}';
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getNumber() {
        return number;
    }

    public void setNumber(Integer number) {
        this.number = number;
    }

    public Person getPerson() {
        return person;
    }

    public void setPerson(Person person) {
        this.person = person;
    }

    public Card() {
    }

    public Card(Integer id, Integer number, Person person) {
        this.id = id;
        this.number = number;
        this.person = person;
    }
}
